package com.dxf.sysadmin.controller;

import com.dxf.common.utils.ResultJson;
import com.dxf.sysadmin.entity.Clazz;
import com.dxf.sysadmin.entity.CourseClazzTeacher;
import com.dxf.sysadmin.entity.qo.MyPage;
import com.dxf.sysadmin.service.CourseClazzTeacherService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/admin/cct")
@Api(tags  = "CourseClazzTeacherController|课表控制器")
public class CourseClazzTeacherController {

    @Autowired
    private CourseClazzTeacherService courseClazzTeacherService;

    /**
     * @Description: 课表列表分页查询
     */
    @PostMapping("cctPage")
    @ApiOperation("课表列表分页查询")
    public ResultJson coursePage(@RequestBody MyPage qry){
        return courseClazzTeacherService.coursePage(qry);
    }

    /**
     * @Description: 下拉选项数据
     */
    @GetMapping("selectData")
    @ApiOperation("下拉选项数据")
    public ResultJson selectData(){
        return courseClazzTeacherService.selectData();
    }

    /**
     * @Description: 新增或者更新课表
     */
    @PostMapping("saveOrUpdate")
    @ApiOperation(value="新增或者更新课表")
    public ResultJson saveOrUpdateCct( @RequestBody CourseClazzTeacher cct){
        return courseClazzTeacherService.saveOrUpdateCct(cct);
    }

    /**
     * @Description: 更具id列表删除课表
     */
    @PostMapping("delete")
    @ApiOperation(value = "更具id列表删除课表")
    public ResultJson deleteCct(@RequestParam("list[]") List<Long> list){
        return courseClazzTeacherService.deleteCct(list);
    }
}
